﻿namespace tinfosvr
{
    using System;
    using System.IO;
    using System.Threading;

    class Program
    {
        private static void Main(string[] args)
        {
            AutoResetEvent event2 = new AutoResetEvent(false);
            if (args.Length != 0)
            {
                string path = args[0];
                if (Directory.Exists(path))
                {
                    TrainTimesUpdater.GetInstance().MaintainTrainTimes(path, 0x83);
                }
            }
            else
            {
                TrainTimesUpdater.GetInstance().LoadData();
                TrainTimesServer server1 = new TrainTimesServer();
                server1.Init();
                event2.WaitOne();
                server1.dispose();
            }
        }
    }
}

